package LibDL.eval.cluster;

import LibDL.core.Tensor;
import LibDL.eval.Evaluator;

public abstract class AbstractUnsupervisedClusterEvaluator implements Evaluator {
    private Tensor X;
    private Tensor labels;

    protected abstract double core(Tensor X, Tensor labels);

    public double evaluate(Tensor X, Tensor labels){
        setX(X);
        setLabels(labels);
        return core(X, labels);
    }

    @Override
    public double evaluate() {
        return core(getX(),getLabels());
    }

    public Tensor getX() {
        return X;
    }

    public AbstractUnsupervisedClusterEvaluator setX(Tensor x) {
        X = x;
        return this;
    }

    public Tensor getLabels() {
        return labels;
    }

    public AbstractUnsupervisedClusterEvaluator setLabels(Tensor labels) {
        this.labels = labels;
        return this;
    }
}
